import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        int count = 0;
        for(int i = 0; i < n-1; i++) {
            int h = 0;
            for(int j = i; j < n; j++) {
                h += arr[j];
                if(h / (double)(j - i + 1) > m) {
                    count++;
                }
            }
        }
        System.out.println(count%10000007);
    }
}
